switch(mod){
	case "penduduk":
		$('#tahun').numberbox({  
			min:0
		});
		$('#jumlah_penduduk').numberbox({  
			min:0,
			groupSeparator:',' 
		});
		$('#jumlah_pencari_kerja').numberbox({  
			min:0,
			groupSeparator:',' 
		}); 
	break;
	case "headline":
		
	break;
	case "potensi":
		$('#tahun').numberbox({  
			min:0
		});
		$('#jumlah').numberbox({  
			min:0,
			groupSeparator:',' 
		});
	break;
	case "pdrb":
		$('#tahun').numberbox({  
			min:0
		});
		$('#pmdn').numberbox({  
			min:0,
			groupSeparator:',' 
		});
		$('#pma').numberbox({  
			min:0,
			groupSeparator:',' 
		});
		$('#pdrb').numberbox({  
			min:0,
			groupSeparator:',' 
		});
	break;
	case "ekonomi":
		$('#tahun').numberbox({  
			min:0
		});
		$('#pendatan_kapita').numberbox({  
			min:0,
			groupSeparator:',' 
		});
		
		$('#pdrb').numberbox({  
			min:0,
			groupSeparator:',' 
		});
		$('#inflasi').numberbox({  
			min:0,
			groupSeparator:',' 
		});
	break;
	case "berita":
		var today = new Date();
		var dd = today.getDate();
		var mm = today.getMonth()+1; //January is 0!
		
		var yyyy = today.getFullYear();
		
		//$('#tool_vr').css('width',frmWidth-20)
		if(dd<10){dd='0'+dd} 
		if(mm<10){mm='0'+mm}
		today = yyyy+'-'+mm+'-'+dd;
		val_date = today;
		console.log(today);
               
		$('#tanggal').datebox({ 
			required: true,
			formatter: formatDate }
		);
		$('#tanggal').datebox('setValue',today);
	break;
}

$('#simpan').die();
$('#simpan').live('click',function(){
	load_na('show');
	if(mod=='headline' || mod=='berita' ){
		tinyMCE.get("isi").save();
	}
	submitform1('form_'+mod,function(r){
		if(r==1){
			$.messager.alert("Sukses","Data Tersimpan",'info');	
			load_na('hide');
			$(tabel).datagrid('reload');
			if(mod!='berita'){
				window_na_close();
			}else{
				$('#data_na').css('display','inline');$('#form_na').css('display','none');
			}
		}
		else{
			console.log(r);
			$.messager.alert("Sukses","Data Gagal Disimpan",'error');	
			load_na('hide');
		}
	});
});

$('#batal').die();
$('#batal').live('click',function(){
	if(mod!='berita'){
		window_na_close();
	}else{
		//$('#data_na').css('display','inline');$('#form_na').css('display','none');
		loadUrl(this,'adminpanel/getdisplay/get_formna/berita','Manajemen Konten BeritaBerita');
	}
});
